package com.google.code.b0rx0r.advancedSamplerEngine.effect;

import com.google.code.b0rx0r.advancedSamplerEngine.AbstractEnqueueable;
import com.google.code.b0rx0r.advancedSamplerEngine.ChannelOutputMap;
import com.google.code.b0rx0r.advancedSamplerEngine.Enqueueable;
import com.google.code.b0rx0r.advancedSamplerEngine.effect.modulation.Modulation;

public abstract class AbstractEffect extends AbstractEnqueueable {
  protected Enqueueable wrapped;
  protected Modulation modulation = Modulation.NULL;

	public AbstractEffect(Enqueueable wrapped) {
		this(wrapped, wrapped.getOutputMap());
	}

	public AbstractEffect(Enqueueable wrapped, ChannelOutputMap outputMap) {
		super(outputMap);
		this.wrapped = wrapped;
	}

	public Modulation getModulation() {
		return modulation;
	}

	public Enqueueable setModulation(Modulation modulation) {
		if (modulation == null)
			this.modulation = Modulation.NULL;
		else
		  this.modulation = modulation;
		
		return this;
	}
	
	public void setModulationGlobalOffset(long offset) {
		modulation.setGlobalOffset(offset);
		
		wrapped.setModulationGlobalOffset(offset);
	}
	
  
	
  
}
